<?php
@header("Content-Type:text/html;charset=utf-8");

@include_once("conn.php");

if (!(isset($_POST["account"]) && isset($_POST["pwd"]))) {
    $obj = array();
    $obj["status"] = false;
    $obj["msg"] = "请输入完整参数";
    $json = json_encode($obj);
    exit($json);
}


$account = $_POST["account"];
$pwd = $_POST["pwd"];

$sql = "select * from `userinfo` where user='$user' or phone='$phone' or email = '$account'";

$obj = array();
if ($result) {
    $item = mysqli_fetch_assoc($result);

    if ($item) {

        $realPwd = $item["pwd"];
        if ($pwd == $realPwd) {
            $obk["status"] = true;
            $obj["msg"] = "登录成功";
            $obj["user"] = $item["user"];
        } else {
            $obj["status"] = false;
            $obj["msg"] = "账号或密码有误";
        }
    } else {
        $obj["status"] = false;
        $obj["msg"] = "该账号未注册";
    }
} else {
    $obj["status"] = false;
    $obj["msg"] = "sql语句有误";
    $obj["sql"] = $sql;
}
echo json_encode($obj);
